const path = require('path')
const name = 'OMS3.0'

// const port = 9527

function resolve(dir) {
  return path.join(__dirname, dir)
}

module.exports = {
  publicPath: process.env.NODE_ENV === 'production' ? './' : '/',
  outputDir: 'dist',
  lintOnSave: true,
  pluginOptions: {
    'style-resources-loader': {
      preProcessor: 'less',
      patterns: [path.resolve(__dirname, 'src/styles/variable.less')]
    }
  },
  devServer: {
    overlay: {
      warnings: false,
      error: false
    },
    proxy: {
      '/api': {
        target: 'http://121.41.129.125:12345',//线上地址
        pathRewrite: { '^/api': '' },
        ws: false,
        changeOrigin: true
      }
      // '/api': {
      //   target: 'http://192.168.3.200',
      //   pathRewrite:{'^/api':''},			
      //   ws: false,							
      //   changeOrigin: true
      // }      
    }
  },
  configureWebpack: {
    name: name,
    resolve: {
      alias: {
        '@': resolve('src')
      }
    }
  }
}
